Problem: $f(x) = |x-1|$ Evaluate the definite integral. $\int^3_{0}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $\dfrac{5}2$ (Choice B) B $\dfrac{15}2$ (Choice C) C $7$ (Choice D) D $\dfrac{9}2$
Splitting up the absolute value Notice that the absolute value function is a piecewise function. Here we have that: $f(x) = \begin{cases} x -1 & \text{for} ~~~~x\geq1 \\ 1-x & \text{for} ~~~~ x \lt1\end{cases}$ Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^3_{0}f(x)\,dx$ $= \int^3_{1}f(x)\,dx + \int^1_{0}f(x)\,dx~~~~~~$ [Why did we split at 1?] $= \int^3_{1}(x - 1)\,dx + \int^1_{0}(1-x)\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^3_{1}(x - 1)\,dx~ &=\dfrac12x^2 - x\Bigg|^3_{{1}} \\\\ &= \left[\dfrac12 ( 3)^2 - (3) \right] - \left[\dfrac12({1})^2 - ({1}) \right] \\\\ &= \left[\dfrac{3}{2}\right] -\left[-\dfrac12 \right] \\\\ &= {2}\end{aligned}$ The second definite integral: $\begin{aligned} \int^1_{0}(1 - x)\,dx~ &=x - \dfrac12x^2\Bigg|^1_{{0}} \\\\ &= \left[(1)-\dfrac12 ( 1)^2 \right] - \left[ ({0})-\dfrac12({0})^2 \right] \\\\ &= \left[\dfrac{1}{2}\right] -\left[0 \right] \\\\ &= {\dfrac12}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^3_{1}(x - 1)\,dx + \int^1_{0}(1-x)\,dx$ $ = {2} + {\dfrac12}$ $ = \dfrac{5}2$ The answer $\int^3_{0}f(x)\,dx = \dfrac{5}2$